package com.bootdo.hotel.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.hotel.dao.HotelRoomMoneyCodeDao;
import com.bootdo.hotel.domain.HotelRoomMoneyCode;
import com.bootdo.hotel.service.HotelRoomMoneyCodeService;



@Service
public class HotelRoomMoneyCodeServiceImpl implements HotelRoomMoneyCodeService {
	@Autowired
	private HotelRoomMoneyCodeDao hotelRoomMoneyCodeDao;
	
	@Override
	public HotelRoomMoneyCode get(Long id){
		return hotelRoomMoneyCodeDao.get(id);
	}
	
	@Override
	public List<HotelRoomMoneyCode> list(Map<String, Object> map){
		return hotelRoomMoneyCodeDao.list(map);
	}

	@Override
	public HotelRoomMoneyCode getRoomMinMoneyCodeByDate(Long hotelId, Long roomTypeId,  String  memberLevelList, String startTime, String endTime) {
		return hotelRoomMoneyCodeDao.getRoomMinMoneyCodeByDate(hotelId,roomTypeId,memberLevelList,startTime,endTime);
	}

	@Override
	public List<HotelRoomMoneyCode> getRoomMoneyCodeByDate(Long hotelId, Long roomTypeId, String  memberLevelList, String startTime, String endTime) {
		return hotelRoomMoneyCodeDao.getRoomMoneyCodeByDate(hotelId,roomTypeId,memberLevelList,startTime,endTime);
	}

	@Override
	public List<HotelRoomMoneyCode> getRoomMoneyCodeByDateGroupId(Long hotelId, Long roomTypeId,  String  memberLevelList, String startTime, String endTime) {
		return hotelRoomMoneyCodeDao.getRoomMoneyCodeByDateGroupId(hotelId,roomTypeId,memberLevelList,startTime,endTime);
	}

	@Override
	public int count(Map<String, Object> map){
		return hotelRoomMoneyCodeDao.count(map);
	}
	
	@Override
	public int save(HotelRoomMoneyCode hotelRoomMoneyCode){
	
		if(hotelRoomMoneyCode.getId() != null) {
			return hotelRoomMoneyCodeDao.update(hotelRoomMoneyCode);
		}else {
			return hotelRoomMoneyCodeDao.save(hotelRoomMoneyCode);
		}		
	
		
	}
	
	@Override
	public int update(HotelRoomMoneyCode hotelRoomMoneyCode){
		return hotelRoomMoneyCodeDao.update(hotelRoomMoneyCode);
	}
	
	@Override
	public int remove(Long id){
		return hotelRoomMoneyCodeDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return hotelRoomMoneyCodeDao.batchRemove(ids);
	}
	
}
